import android.view.Gravity
import android.widget.Toast
import androidx.annotation.StringRes
import com.asman.worker.MainApplication

fun showToast(msg: CharSequence) {
    val toast = Toast.makeText(MainApplication.context, msg, Toast.LENGTH_SHORT)
    toast.setGravity(Gravity.CENTER, 0, 0)
    toast.show()
}

fun showToast(@StringRes resId: Int) {
    showToast(MainApplication.context.resources.getText(resId))
}